{extend name="pc/admin/layout"/}
{block name="main"}
   <div class="g-1400 g-container" id="pjax-container">
        
<div class="bg-bai b rx3" id="vue-page">
<form id="form-config">
    <div class="t-v t-t">
        <div class="c-sidebar c-sidebar-h pb5 br">
            <div class="c-sidebar-title t-v hui bb">网站基础设置</div>
            <ul class="c-nav click-nav">
                <li><a href="{:url('pc/admin')}" class="t-v" data-pjax>
                    <div><i class="icon icon-form"></i></div>
                    <div>网站信息</div>
                </a></li>
				<li><a href="{:url('pc/admin',['act'=>'set','s'=>'reg'])}" class="t-v" data-pjax>
                    <div><i class="icon icon-form"></i></div>
                    <div>注册奖励</div>
                </a></li>
				<li><a href="{:url('pc/admin',['act'=>'set','s'=>'mail'])}" class="t-v" data-pjax>
                    <div><i class="icon icon-form"></i></div>
                    <div>邮箱提醒</div>
                </a></li>
				<li class="active"><a href="{:url('pc/admin',['act'=>'set','s'=>'chat'])}" class="t-v" data-pjax>
                    <div><i class="icon icon-form"></i></div>
                    <div>聊天发言</div>
                </a></li>
				{if condition="config('web_web_id') eq 1"}
				<li><a href="{:url('pc/admin',['act'=>'set','s'=>'task'])}" class="t-v" data-pjax>
                    <div><i class="icon icon-form"></i></div>
                    <div>任务运行</div>
                </a></li>
				<li><a href="{:url('pc/admin',['act'=>'set','s'=>'cron'])}" class="t-v" data-pjax>
                    <div><i class="icon icon-form"></i></div>
                    <div>任务监控</div>
                </a></li>
				{/if}
				<li><a href="{:url('pc/admin',['act'=>'set','s'=>'plugins'])}" class="t-v" data-pjax>
                    <div><i class="icon icon-form"></i></div>
                    <div>网站插件</div>
                </a></li>
				{if condition="config('web_web_id') eq 1"}
				<li><a href="{:url('pc/admin',['act'=>'set','s'=>'server'])}" class="t-v" data-pjax>
                    <div><i class="icon icon-form"></i></div>
                    <div>服务器设置</div>
                </a></li>
				{/if}
            </ul>
        </div>
<div class="c-content bl">
			<div class="g-title t-v pl4 bb">
				<div class="col-12 h t-v bold">聊天室配置</div>
			</div>
            <div class="g-content p5">
				<div class="p5 o-h">
					<div class="pt1 pb3 in-text">
						<dt class="bold bb pr2 lan">开启HTTPS</dt>
						<dd><select class="form w h8 bb" name="chat_https" default="{:config('sys_chat_https')}">
							<option value="0">关闭</option>
							<option value="1" {if condition="config('sys_chat_https') eq 1" }selected {/if}>开启</option>
						</select></dd>
					</div>
					<div class="pt1 pb3 in-text">
						<dt class="bold bb pr2 lan">选择WS服务器</dt>
						<dd><select class="form w h8 bb" name="chat_ws" default="{:config('sys_chat_ws')}">
							<option value="1" {if condition="config('sys_chat_ws') eq 1" }selected {/if}>59提供 wss.phpfn.cn</option>
						</select></dd>
					</div>
					<div class="pt1 pb3 in-text">
						<dt class="ml4 f3 hui"><font class="hong">根据实际情况选择</font></br>当网站开启https协议的时候需要配置反向代理<br>详细说明查看码云文档:<a href="https://gitee.com/sexz/Weaving-Tools/blob/master/README.md">README.md</a></dt>
					</div>
					<div class="pt1 pb3 in-text">
						<dt class="bold bb pr2 lan">发言时间周期(秒)</dt>
						<dd><input type="text" class="form w h8 bb" name="timelimit" value="{:config('sys_timelimit')}"></dd>
					</div>
					<div class="pt1 pb3 in-text">
						<dt class="bold bb pr2 lan">同IP限制周期条数</dt>
						<dd><input type="text" class="form w h8 bb" name="iplimit" value="{:config('sys_iplimit')}"></dd>
					</div>
					<div class="pt1 pb3 in-text">
						<dt class="bold bb pr2 lan">限制聊天内容字数</dt>
						<dd><input type="text" class="form w h8 bb" name="zishu" value="{:config('sys_zishu')}"></dd>
					</div>
					<div class="pt3 pb3">
						<div><font class="f4 bold lan">敏感词汇列表</font><font class="ml4 f3 hui">多个用英文逗号分隔，例如：傻逼,操你妈,支持泛屏蔽，例如：操</font></div>
						<div class="mt2"><textarea type="text" class="form b" name="backlist" placeholder="敏感词汇列表" rows="3" autocomplete="off">{:config('sys_backlist')}</textarea></div>
					</div>
					<div class="pt1 pb3 in-text">
						<dt class="bold bb pr2 lan">触发敏感词汇机制禁言时间(秒)</dt>
						<dd><input type="text" class="form w h8 bb" name="jy_s" value="{:config('sys_jy_s')}"></dd>
					</div>
				</div>
            </div>
        </div>
</div>
</form>
<div class="c-pagination o-h t-v">
        <div class="c-sidebar"></div>
        <div class="c-content h11 o-h g-btn t-v bt bl">
            <div class="col-12 h t-v f3 hui pl5 pr5 t-c">
			<button class="btn btn-qing btn-md w22 rx1" @click="saveConfig()">保 存 设 置</button></div>
        </div>
    </div>
</div>

    </div>
   {/block}
   {block name='foot'}
		<script>
        new Vue({
                el: '#vue-page',
                methods: {
                    saveConfig: function () {
                        app.ajax("{:url('admin_ajax/config')}", $("#form-config").serialize(), function (data) {
                            if (data.code === 0) {
                                x.msg(data.message)
                            } else {
                                x.msg(data.message)
                            }
                        })
                    },
                }
            });
    </script>
    {/block}